package com.journaldev.spring.service;

import java.util.List;
import java.util.Set;

import com.journaldev.spring.dao.UserInfoDAO;
import com.journaldev.spring.model.Patient;
import com.journaldev.spring.model.UserInfo;

public class UserInfoServiceImpl implements UserInfoService {

	private UserInfoDAO userDAO;
	
	public UserInfoDAO getUserDAO() {
		return userDAO;
	}

	public void setUserDAO(UserInfoDAO userDAO) {
		this.userDAO = userDAO;
	}

	@Override
	public void addUserInfo(UserInfo p) {
		// TODO Auto-generated method stub
		this.userDAO.addUserInfo(p);
	}

	@Override
	public void updateUserInfo(UserInfo p) {
		// TODO Auto-generated method stub
		this.userDAO.updateUserInfo(p);
	}

	@Override
	public List<UserInfo> listUser() {
		// TODO Auto-generated method stub
		return this.userDAO.listUser();
	}

	@Override
	public UserInfo getUserInfoById(int id) {
		// TODO Auto-generated method stub
		return this.userDAO.getUserInfoById(id);
	}

	@Override
	public void removeUserInfo(int id) {
		// TODO Auto-generated method stub
		this.userDAO.removeUserInfo(id);
	}

	@Override
	public UserInfo authenticateUser(String userName, String password) {
		// TODO Auto-generated method stub
		return this.userDAO.getUserByNameAndPass(userName, password);
		
	}

	@Override
	public Set<Patient> getListPatient(int doctorId) {
		// TODO Auto-generated method stub
		return this.userDAO.getListPatient(doctorId);
	}

}
